package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.nursing.dto.MemberLoginDTO;
import com.zzyl.nursing.service.IMemberService;
import com.zzyl.nursing.vo.LoginVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author byZhao
 * @create 2025/7/2 11:43
 * @description
 *
 *  实现小程序用户登录功能！
 *
 */
@RequestMapping("/member/user")
@RestController
public class MemberController {

    @Autowired
    private IMemberService memberService;

    @PostMapping(path = "/login")
    public AjaxResult login(@RequestBody MemberLoginDTO dto) {
        LoginVO login = memberService.login(dto);
        return AjaxResult.success(login);
    }
}
